Copying table from one module to another?

Hi all,

I've been put in charge of writing some DXL scripts that compare two different versions of a module (in two different projects). The idea is that the "older" module should be updated to be identical (or as close as possible) to the "newer" module. To that end, the program has a number of cases. I compare objects by absolute number, and if an object with the same absolute number exists in both modules, the older one is updated to reflect the newer object's attributes. If an object exists in the older module, but is not in the newer one, it's deleted from the older module. If the object does not exist in the older one but does in the new, then it should be added to the "older" module. In this case, I've developed a pretty decent way to determine where the object should be placed, given that it's a normal object. Tables, however, are where things get tricky, and a coworker suggested that it might be easier to copy over the entire table in the case that we find a table that's been changed at all - copying the whole table will obviously prevent me from having to muck around with formatting the tables. I've tried using some of the functions in the DXL guide to copy the object - using the getTable function, trying to use copyHier() and paste() by using the clipboard. However, I'm either doing something wrong with the clipboard or it's preventing me from copying an object from one module in a project from another in another project. Are there any other methods of copying objects/entire tables that I missed here? I'm fully aware I can click and drag entire tables over, but that's not what I'm looking for, as that's a lot of manual work. If there is a programmatic way to move these tables, that would be incredibly helpful.

Thanks!

 


cmoughon - Wed Jul 19 12:38:23 EDT 2017

Re: Copying table from one module to another?
Mathias Mamsch - Wed Jul 19 12:55:19 EDT 2017

I always thought "copying object" to be a solved problem thanks to "copyops.inc" that ships with any DOORS client. Anyway to copy a table, you first create a 1:1 Object copy (without creating a table), i.e. you replicate the Object Hierarchy of the table in the target module ... finally you call toTable_(tableRoot) in the target module which will make the objects a DOORS table. Maybe this helps, regards, Mathias